import React, { Component } from 'react';
import emitter from './events';

class Button extends Component {
  handleClick () {
    emitter.emit('changeColor', this.props.color);
  }
  render() {
    return (
      <div>
        <button onClick={this.handleClick.bind(this)}>我是个按钮</button>
      </div>
    );
  }

}

export default Button;
